<?php
namespace Api\Event;

/**
 * 主页活动广告
 * @author liubo <liubo@ilongyuan.com.cn>
 */
class EventsEvent extends BaseEvent
{
    /**
     * 模型对象
     */
    protected $mod;

    /**
     * 成员变量的初始化
     */
    protected function _initialize() {
        parent::_initialize();
        $this->mod = D( 'Common/Events', 'Service' );
    }

    /**
     * 活动详情
     * @author liubo <liubo@ilongyuan.com.cn>
     * @param  integer $id
     * @return Array
     */
    public function detail($id) {
        $result = $this->mod->where(['id' => $id, 'status' => 1])->field('id,title,content')->find();
        return $result;
    }
}